/*
 * @Description: 创建对象组合模式
 * @Author: rendc
 * @Date: 2021-09-03 10:31:34
 * @LastEditors: rendc
 * @LastEditTime: 2021-09-03 15:32:26
 */
function Person (name, age, gender) {
  this.name = name,
    this.age = age,
    this.gender = gender,
    this.likes = []
}
Person.prototype = {
  constructor: Person,
  sayName: function () {
    console.log(this.name);
  }
}

var p1 = new Person('larry', 12, '男');
p1.likes.push('打🏀');
var p2 = new Person('terry', 23, '男');
p2.likes.push('踢⚽️');

console.log(p1);
console.log(p2);






